//
//  LQYMineTableViewCell.m
//  基本框架
//
//  Created by runone02 on 2018/6/27.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

#import "LQYMineTableViewCell.h"


NSString *const FindCellImageName = @"image";
NSString *const FindCellContentStr = @"title";
@interface LQYMineTableViewCell()

@end
@implementation LQYMineTableViewCell


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setupUI {
    self.iconImage = [[UIImageView alloc]init];
    [self addSubview:self.iconImage];
    [self.iconImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.left.mas_equalTo(20);
        make.width.height.mas_equalTo(20);
    }];
    
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.textColor = [UIColor blackColor];
    [self addSubview:self.nameLabel];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.left.mas_equalTo(self.iconImage.mas_right).with.offset(10);
    }];
    
    self.arrowImage = [[UIImageView alloc]init];
    [self.arrowImage setImage:IMAGE(@"Shape1")];
    [self addSubview:self.arrowImage];
    [self.arrowImage  mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.right.mas_equalTo(-10);
        make.width.height.mas_equalTo(10);
    }];
    
    self.cueBtn = [[UIButton alloc]init];
    [self.cueBtn setImage:IMAGE(@"login_regist_btn") forState:UIControlStateNormal];
    [self addSubview:self.cueBtn];
    
    [self.cueBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.arrowImage.mas_left).with.offset(-10);
        make.centerY.mas_equalTo(self);
        make.width.mas_equalTo(60);
    }];
    
//    self.lineView = [[UIView alloc]init];
//    self.lineView.backgroundColor = RGB(238, 238, 238);
//    [self addSubview:self.lineView];
//    
//    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.bottom.mas_equalTo(self);
//        make.right.mas_equalTo(self);
//        make.height.mas_equalTo(2);
//        make.left.mas_equalTo(self.nameLabel.mas_left);
//    }];
}

- (void)setContentData:(NSDictionary *)dic {
    self.iconImage.image = [UIImage imageNamed:[dic valueForKey:FindCellImageName]];
    self.nameLabel.text = [dic valueForKey:FindCellContentStr];
}
@end
